var t = getApp();

Page({
    data: {
        infoData: []
    },
    onLoad: function(a) {
        if (this.data.options = a, a.scene) {
            var i = [];
            i = decodeURIComponent(a.scene).split(",");
            for (var o = 0; o < i.length; o++) {
                var n;
                "id" == (n = i[o].split("="))[0] && (this.data.options.id = n[1]), "uid" == n[0] && (this.data.options.uid = n[1]), 
                "mid" == n[0] && t._setMid(n[1]);
            }
        }
    },
    toOrder: function(t) {
        var a;
        console.log(t);
        var i = this.data.infoData.id;
        t.currentTarget.dataset.key && (a = t.currentTarget.dataset.key), a ? this.data.options.uid ? wx.navigateTo({
            url: "/packageF/crowd_activity/order/crowd_activity_Order?id=".concat(i, "&uid=").concat(this.data.options.uid, "&self=true")
        }) : wx.navigateTo({
            url: "/packageF/crowd_activity/order/crowd_activity_Order?id=".concat(i, "&self=true")
        }) : this.data.options.uid ? wx.navigateTo({
            url: "/packageF/crowd_activity/order/crowd_activity_Order?id=".concat(i, "&uid=").concat(this.data.options.uid)
        }) : wx.navigateTo({
            url: "/packageF/crowd_activity/order/crowd_activity_Order?id=".concat(i)
        });
    },
    onReady: function() {},
    onShow: function() {
        this.getData();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {},
    onChange: function(t) {
        this.setData({
            timeData: t.detail
        });
    },
    getData: function() {
        var a = this, i = t.getNetAddresss("plugin.crowdfunding.frontend.activity.show");
        t._getNetWork({
            url: i,
            data: {
                activity_id: this.data.options.id
            },
            success: function(i) {
                var o = i.data;
                if (1 == o.result) {
                    a.setData({
                        infoData: o.data
                    });
                    var n = Date.now();
                    a.setData({
                        "infoData.start_at": Number(o.data.start_at + "000") - n,
                        "infoData.end_at": Number(o.data.end_at + "000") - n
                    }), wx.setNavigationBarTitle({
                        title: a.data.infoData.title
                    });
                } else t.tips(o.msg);
            },
            fail: function(t) {
                console.log(t);
            }
        });
    }
});